﻿Public Class ClsDfrmVersionsManagement
    'represents data object for frmVersions

#Region "Attributes"
#Region "Private attributes"
    Private MoDSaModFile As ClsDSaModFile = Nothing 'aMod file
#End Region
#End Region
#Region "Properties"
#Region "Public attributes"
    Public ReadOnly Property DSaModFile() As ClsDSaModFile
        Get
            Return MoDSaModFile
        End Get
    End Property
#End Region
#End Region

    '#######################################
    'execute function
    Public Function Execute(ByRef OoAction As ClsAction) As GeActionResult
        Try
            Dim LeResult As GeActionResult = GeActionResult.kkOk
            '---------------------------------------------
            'ACTION BEFORE ACTION
            '---------------------------------------------

            '---------------------------------------------
            'ACTION
            '---------------------------------------------
            Select Case OoAction.Action
                Case GeAction.kkaModVersionsManagement
                    MoDSaModFile = OoAction.GetData("DSAMODFILE")

                    Dim LoFrmVersionsManagement As frmVersionsManagement = New frmVersionsManagement
                    OoAction.SetData(Me, "CLSDFRMVERSIONSMANAGEMENT")
                    LeResult = LoFrmVersionsManagement.Execute(OoAction)
                Case GeAction.kkaModTryToOpenVersions
                    OoAction.SetData(MoDSaModFile.Path, "PATHTOFILE")
                    OoAction.SetData(DSaModFile.GetLastVersionModuleName, "MODULENAME")

                    LeResult = CType(OoAction.GetData("SENDER"), UcnDiagramCanvasBase).Execute(OoAction)
                Case GeAction.kkaModDeleteVersions
                    LeResult = CType(OoAction.GetData("SENDER"), UcnDiagramCanvasBase).Execute(OoAction)
                Case GeAction.kkaModExportModuleToXmod
                    LeResult = CType(OoAction.GetData("SENDER"), UcnDiagramCanvasBase).Execute(OoAction)
                Case GeAction.kkaModImportModuleFromXmod
                    LeResult = CType(OoAction.GetData("SENDER"), UcnDiagramCanvasBase).Execute(OoAction)
                Case GeAction.kkamodPromoteVersion
                    LeResult = CType(OoAction.GetData("SENDER"), UcnDiagramCanvasBase).Execute(OoAction)
                Case GeAction.kkaModTryToCompareVersions
                    LeResult = CType(OoAction.GetData("SENDER"), UcnDiagramCanvasBase).Execute(OoAction)
            End Select
            '---------------------------------------------
            'ACTION AFTER ACTION
            '---------------------------------------------

            '---------------------------------------------
            Return LeResult
            '---------------------------------------------

        Catch ex As Exception
            LogEventFromException(ex, , , )
            Return GeActionResult.kkError
        End Try
    End Function
    '#######################################

End Class